This repository was archived by the owner on Dec 25, 2024. It is now read-only.
v3 uses generics in schemas so IDEs can see instance and property base types#169
Closed
v3 uses generics in schemas so IDEs can see instance and property base types#169
Conversation
* Removes get_item_ * Samples and docs updated * Fixes python tests
* Removes overrides from api classes * Fixes type hint for operation methods, reduced 2x duplication * Samples updated * Sample regen
* Converts PrefixSeparatorIterator, Api, and Encoding into dataclasses * ApiClient converted to dataclass * Removes __call_api * Removes unneeded type imports from header * Removes unneeded imports from headers * Removes unneeded imports in responses when they have no content or headers * Removes unneeded header imports * Removes pyi files * Removes functools import * Stops generating new for anytype schemas * Samples regenerated * Fixes this_package security tests
* petstore regen * removes init template * Adds parameters type hint * Centralizes path and query param serialization * Removes type hint for param tuples * Simplifies used_path definition * Adds path + query params inputs * Adds _get_headers * SImplifies header assignment * Adds _get_field_and_body * Adds _verify_response_status * Removes unused imports * Removes unused import * Updates method name * Samples regenerated
* Adds typing_imports * Adds typing_imports for header and parameter * Updates request body imports * Adds response_imports * Adds schema_imports * Adds security_scheme_imports * Adds server imports * Adds operation_imports * typing_imports -> header_imports * Sample regen
Contributor
Author
|
Closing this and work will continue on in #174 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
v3 makes all schema classes based on Generic[T]
So now when models are instantiated, they will show what class they are based on
Like so:
__init__method to AnyTypeSchemaOut of scope future improvement. Use typing.Never in NotAnyType
PR checklist
This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master.
These must match the expectations made by your contribution.
You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example
./bin/generate-samples.sh bin/configs/python*.For Windows users, please run the script in Git BASH.